import Vue from 'vue'
import Router from 'vue-router'
import BoBo from '../pages/BoBo'
import Home from '../pages/home/Home'
import People from '../pages/people/People'
import Goods from '../pages/goods/Goods'
import GoodsDetail from '../pages/goods/GoodsDetail';
import GoodsSearch from '../pages/goods/GoodsSearch';
import Cart from '../pages/ShopCart/ShopCart'
import Login from '../pages/login/Login'
import Regist from '../pages/login/Regist'
import ForgetPW from '../pages/login/ForgetPW'
Vue.use(Router)
export default new Router({
  routes: [
    {
      path: '/',
      redirect:'/BoBo/home',
    },
    {
      path: '/BoBo',
      name: 'BoBo',
      component: BoBo,
      children:[
        {path:'home',component:Home},
        {path:'people',component:People},
        {path:'cart',component:Cart},
        {path:'goods',component:Goods},
      ]
    },
    {path:'/login',name:'login',component:Login},
    {path:'/regist',name:'regist',component:Regist},
    {path:'/forgetpw',name:'forgetpw',component:ForgetPW},
    {
        path: '/BoBo/GoodsDetail/:id', // 定义商品详情页的动态路由
        name: 'goods-detail',
        props:true,
        component: GoodsDetail, 
    },
    {
        path: '/BoBo/GoodsSearch', // 定义商品详情页的动态路由
        name: 'goods-search',
        component: GoodsSearch, 
    }
  ]
})
